import request from '@/utils/request'

// 查询原料成分管理列表
export function listIngredient(query) {
  return request({
    url: '/rm/ingredient/list',
    method: 'get',
    params: query
  })
}

// 查询原料成分管理详细
export function getIngredient(id) {
  return request({
    url: '/rm/ingredient/' + id,
    method: 'get'
  })
}

// 新增原料成分管理
export function addIngredient(data) {
  return request({
    url: '/rm/ingredient',
    method: 'post',
    data: data
  })
}

// 修改原料成分管理
export function updateIngredient(data) {
  return request({
    url: '/rm/ingredient',
    method: 'put',
    data: data
  })
}

// 删除原料成分管理
export function delIngredient(id) {
  return request({
    url: '/rm/ingredient/' + id,
    method: 'delete'
  })
}

// 查询原料成分管理详细
export function getAddIngredient() {
  return request({
    url: '/rm/ingredient/getAddIngredient/2',
    method: 'get',
  })
}

//高级搜索
  export function AdvancedSearch(data) {
    return request({
      url: '/rm/ingredient/AdvancedSearch',
      method: 'post',
      data: data
    })
  }